﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Configuration;

namespace CollegeShop.Repository.Win
{
    static class Program
    {
        //全局样式
        public static string skinNameGlobal = string.Empty;
        //项目名称
        public static string frmNameGlobal = string.Empty;
        //学校代号
        public static int college = 0;


        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            setConfig();
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("zh-CHS");
            DevExpress.UserSkins.BonusSkins.Register();
            DevExpress.UserSkins.OfficeSkins.Register();
            DevExpress.Skins.SkinManager.EnableFormSkins();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (!DevExpress.Skins.SkinManager.AllowFormSkins)
            {
                DevExpress.Skins.SkinManager.EnableFormSkins();
            }
            DevExpress.XtraEditors.Controls.Localizer.Active = new CollegeShop.Repository.Win.DevHelper.LocalizationCHS();
            DevExpress.XtraGrid.Localization.GridLocalizer.Active = new CollegeShop.Repository.Win.DevHelper.DevLocalizer();


            Application.Run(new F_Login());
        }

        private static void setConfig()
        {
            string skinName = ConfigurationManager.AppSettings["skinName"];
            if (!String.IsNullOrEmpty(skinName))
            {
                skinNameGlobal = skinName;
            }
            string frmName = ConfigurationManager.AppSettings["frmName"];
            if (!String.IsNullOrEmpty(frmName))
            {
                frmNameGlobal = frmName;
            }
            string strCollege = ConfigurationManager.AppSettings["college"];
            if (!String.IsNullOrEmpty(strCollege))
            {
                college = Convert.ToInt32(strCollege);
            }
        }
    }
}
